import math
def Csum(num1,num2):
    return num1+num2
def Csub(num1,num2):
    return num1-num2
def Cmulti(num1,num2):
    return num1*num2
def CDiv(num1,num2):
    if num2 == 0:
        print("除数不能为0")
        return 0
    return num1/num2
def logab(a,b):
    return math.log(a,b)

flag = True
while flag:
  if input("复数(1)or实数(2)")=="1":
    num1 = complex(input("input one："))
    num2 = complex(input("input two："))
  else:
    num1 = int(input("input one："))
    num2 = int(input("input two："))

  choice = input("运算符（+-*/log）:")

  if choice == "+":
      print("num1",choice,"num2 = ",Csum(num1,num2))
  elif choice == "-":
      print("num1", choice, "num2 = ", Csub(num1, num2))
  elif choice == "*":
      print("num1", choice, "num2 = ", Cmulti(num1, num2))
  elif choice == "/":
      print("num1", choice, "num2 = ", CDiv(num1, num2))
  elif choice == "log":
      print("log以", num2, "为底",num1,"的对数 = ", logab(num1, num2))
  x = input("是否继续?Y/N")
  if x == "Y" or x == "y":
      flag = True
  else:
      flag = False